<%-- 
    Document   : changeperson
    Created on : Jun 27, 2012, 11:13:21 AM
    Author     : ems
--%>


<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%@taglib prefix="rich" uri="http://richfaces.org/rich" %>
<%@taglib prefix="a4j" uri="http://richfaces.org/a4j" %>

<script type="text/javascript" language="javascript">
    var open_cur = 0;
    $j = jQuery.noConflict();
    $j(document).ready(function(){

        //fancybox-close
        
        $j("#fancybox-close").live("click",function(){
//            var obj = $j(this).prev('#fancybox-content > div:first').find('form #form1').children('.popup');
//            alert(obj);
            //.prev(".fancybox-content").child().find("#form1").find(".popup").attr('lang')
            //var page =  $j("#btnsave").attr('lang');
            //alert(page);
            //window.parent.location.href=page;
            reloadProject2() 
        });
    });
</script>
<style>
    .content_cmb{
        float: left;
        margin-left: 20px;
        margin-top: 25px;
        width:94%;
    }
    .content_cmb .selectcmb1{
        width:100%;
        float:left;
        margin-bottom: 8px;
    }
    .content_cmb .selectcmb1 label{
        float: left;
        padding:4px;
        width:90px;
        text-align: right;
    }
    .content_cmb .selectcmb1 select{
        float: left;
        height: 24px;
        width: 150px;
    }
    .content_cmb .selectcmb2{
        width:100%;
        float:left;
        margin-bottom: 8px;
    }
    .content_cmb .selectcmb2 label{
        float: left;
        padding:4px;
        width:90px;
        text-align: right;
    }
    .content_cmb .selectcmb2 select{
        float: left;
        height: 24px;
        width: 150px;
    }
    .content_cmb .selectcmb3{
        width:100%;
        float:left;
        margin-bottom: 8px;
    }
    .content_cmb .selectcmb3 label{
        float: left;
        padding:4px;
        width:90px;
        text-align: right;
    }
    .content_cmb .selectcmb3 select{
        float: left;
        height: 24px;
        width: 150px;
    }


</style>
<f:view>
    <f:loadBundle basename="#{environmentSession.localizationSource}" var="locale"/>
    <a4j:form id="form1" >
        <div class="popup" lang="<h:outputText value="#{k100Controller.pagecurent}" /> " style="height:200px; width:350px">
            <div class="popup-header">
                <div class="title">
                    <h:outputText rendered="#{loginSession.right.CUS_LST_DEL}" value="#{locale.representative}">
                        <f:param name="abc" value="CUS_PERMISSION" />
                    </h:outputText></div>
            </div>

            <div class="popup-content">
                <div class="main_content">
                    <div class="content_cmb">
                        <div class="selectcmb1">
                            <label><h:outputText value="#{locale.department}"/>:</label>&nbsp;
                            <h:selectOneMenu  styleClass="combobox"  id="cmbNv113" value="#{k100Controller.FN850}" >
                                <f:selectItems value="#{k100Controller.combN850}" />
                                <a4j:support event="onchange" actionListener="#{k100Controller.changeCombN850forN900}"
                                             reRender="nv113" />
                            </h:selectOneMenu>
                        </div>

                        <div class="selectcmb2" >
                            <label><h:outputText value="#{locale.employee}"/>:</label>&nbsp;
                            <h:selectOneMenu id="nv113" value="#{k100Controller.KV104}"  styleClass="combobox">
                                <f:selectItems value="#{k100Controller.combN900}"></f:selectItems>
                            </h:selectOneMenu>
                        </div>


                    </div>
                </div>
            </div>
            <div class="popup-footer">
                <div class="buttonsave" id ="btnsave" lang="<h:outputText value="#{k100Controller.pagecurent}" /> " onclick="reloadProject2()"><span><h:outputText value="#{locale.close}"/></span></div>
                <a4j:commandButton  action="#{k100Controller.saveColumnK100}" value="#{locale.save}" styleClass="buttonsave"  reRender=":form1">
                </a4j:commandButton>

                <h:inputHidden value="#{k100Controller.PK100}" id="pk100" />
                <h:inputHidden value="#{k100Controller.flag}" id="flag" />
                


            </div>
        </div>

    </a4j:form>
</f:view>
<script type="text/javascript">
    $j(document).ready(function(){
        yhight = ($j('.popup').height()-90)+"px" ;
        $j('.main_content').css('height',yhight );
        $j('.popup-content').css('height',yhight );
    });
    function reloadProject(){
        // self.parent.tb_remove();
        var page =  $j('#btnsave').attr('lang');
        window.parent.location.href= page;
    }
    function reloadProject2(){
       var url = window.location.pathname;
        var urlparts = url.split('/');
        var page = urlparts[4];
        window.parent.location.href= page;
    }
</script>